package miracle.joker.design.decorator;

public class DecoratorDemo {

    public static void main(String[] args) {
        FileAccess fileAccessor = new SimpleFileAccessor();
        fileAccessor.write("sample.txt");
//        fileAccessor.read("sample.txt");

        FileAccess encryptedFileAccessor = new EncryptionDecorator(fileAccessor);
        encryptedFileAccessor.write("encryptedSample.txt");
//        encryptedFileAccessor.read("encryptedSample.txt");

        FileAccess compressedFileAccessor = new CompressionDecorator(fileAccessor);
        compressedFileAccessor.write("compressedSample.txt");
//        compressedFileAccessor.read("compressedSample.txt");

        FileAccess encryptedAndCompressedFileAccessor = new CompressionDecorator(new EncryptionDecorator(fileAccessor));
        encryptedAndCompressedFileAccessor.write("encryptedAndCompressedSample.txt");
//        encryptedAndCompressedFileAccessor.read("encryptedAndCompressedSample.txt");
    }
}
